package com.zxjbyte.yiyi.framework.quartz.config;

import com.zxjbyte.yiyi.framework.quartz.manager.QuartzScheduleManager;
import lombok.RequiredArgsConstructor;
import org.quartz.Scheduler;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * Quartz AutoConfiguration
 *
 * @Author zhangxingjia
 * @Date 2023/8/23 17:32
 * @Version: 1.0
 */
@RequiredArgsConstructor
@AutoConfiguration
@EnableConfigurationProperties(QuartzProperties.class)
public class YiyiQuartzAutoConfiguration {

    @Bean
    public QuartzScheduleManager jobScheduleManager(Scheduler scheduler){
        return new QuartzScheduleManager(scheduler);
    }
}
